#include <iostream>
using std::cout;
using std::endl;
//const数据成员和const成员函数组合情况分析
class Test{
public:
    Test()
    :_a(0)
    ,_b(0)
    ,_p(new int())
    ,_p2(new int())
    {

    }

    void func(){
        _a = 20;
        _b = 30;
        _p = new int();
        *_p = 30;
        _p2 = new int();
        *_p2 = 30;
    }
    
    //Type * const this
    void func() const{
        _a = 20;
        _b = 30;
        _p = new int();
        *_p = 30;
        _p2 = new int();
        *_p2 = 30;
    }



private:
    int _a;
    const int _b;
    int * _p;
    const int * _p2;
};


void test(){

}

int main()
{
    test();
    return 0;
}

